package com.ysd.gulimall.cart.service;

import com.ysd.gulimall.cart.vo.Cart;
import com.ysd.gulimall.cart.vo.CartItem;

import java.util.List;
import java.util.concurrent.ExecutionException;

public interface CartService {



    /**
     * 将商品添加到购物车
     * @param skuId
     * @param num
     * @return
     * @throws ExecutionException
     * @throws InterruptedException
     */
    CartItem addToCart(Long skuId, Integer num) throws ExecutionException, InterruptedException;

    /**
     * 获取购物车中某个购物项
     * @param skuId
     * @return
     */
    CartItem getCartItem(Long skuId);
    //获取购物车
    Cart getCart() throws ExecutionException, InterruptedException;

    void clearCart(String cartKey);
    //勾选购物项
    void checkItem(Long skuId, Integer check);
    //修改购物数量
    void changeItemCount(Long skuId, Integer num);
    //删除购物项
    void deleteItem(Long deleteId);

    List<CartItem> getUserCartItems();
}
